<?php
include_once "PDO.class.php";
$mysql = new Db();
$arr=[];
$query = $mysql->list('works',$arr);
?>
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>Layui</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <link rel="stylesheet" href="css/layui.css"  media="all">
    <!-- 注意：如果你直接复制所有代码到本地，上述css路径需要改成你本地的 -->
</head>
<body>
<fieldset class="layui-elem-field layui-field-title" style="margin-top: 20px;">
    <legend>默认表格</legend>
</fieldset>

<div class="layui-form">
    <table class="layui-table">
        <colgroup>
            <col width="150">
            <col width="150">
            <col width="200">
            <col>
        </colgroup>
        <thead>
        <tr>
            <th>ID</th>
            <th>职位</th>
            <th>地址</th>
            <th>薪资</th>
            <th>年限</th>
            <th>公司</th>
            <th>操作</th>
        </tr>
        </thead>
        <tbody>
            <?php foreach ($query as $k=>$v) {?>
                <tr>
                    <td><?php echo $v['id']?></td>
                    <td><?php echo $v['work']?></td>
                    <td><?php echo $v['address']?></td>
                    <td><?php echo $v['money']?></td>
                    <td><?php echo $v['age']?></td>
                    <td><?php echo $v['job']?></td>
                    <td><a href="del.php?id=<?php echo $v['id']?>">删除</a></td>
                    <td><a href="upd.php?id=<?php echo $v['id']?>">修改</a></td>
                </tr>
            <?php }?>
        </tbody>
    </table>
</div>


<script src="layui.js" charset="utf-8"></script>
<!-- 注意：如果你直接复制所有代码到本地，上述js路径需要改成你本地的 -->
<script>

</script>

</body>
</html>
